clear all
clc

L1 = 0;
L2 = 0.75;
L3 = 1.25;
L4 = 2;

N1 = 10;
N2 = 20;
N3 = 10;

d1 = (L2-L1)/N1;
d2 = (L3-L2)/N2;
d3 = (L4-L3)/N3;

ya (1) = d1;



for i=2:N1
    
    ya(i) = ya(i-1) + d1;
    
end

yb(1) = L2

for i=2:N2
    
    yb(i) = yb(i-1) + d2;
    
end

yc(1) = L3

for i=2:N3-1
    
    yc(i) = yc(i-1) + d3;
    
end

y = [ya , yb , yc]

% h = hp-1/n;
%
% y = y*h/max(y);
%
% dymin = y(1);
%
% h2 = 1;
% n2 = h2/dymin;



Nin     = 10;
Nt      = 50;
Nout    = 30;

Lin     = 3.5;
Lt      = 7;
Lout    = 12;

dxin     = Lin / Nin;
dxt      = (Lt-Lin) / Nt;
dxout    = (Lout-Lt) / Nout;

dimXp  = Nin+Nt+Nout;
dimDxp = Nin+Nt+Nout-1;

x = zeros (dimXp,1);
dxp = zeros (dimDxp,1);

x (1) = 0;

for i=2:Nin
    x (i) = x(i-1) + dxin;
end
for i=1:Nt
    x (Nin+i) = x(Nin+i-1) + dxt;
end
for i=1:Nout
    x (Nin+Nt+i) = x(Nin+Nt+i-1) + dxout;
end

dimYp = size(y,2);

for i=1:dimXp
    for j=1:dimYp
        Xp (i,j) = x(i);
        Yp (i,j) = y(j);
    end
end



plot (Xp,Yp,'x')



for i=1:dimXp
    
    DXp (i) = x
    
end

for j=1:dimYp
    DYp (j) = y(j);
end

